<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name ="viewport" content ="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <!-- import CSS -->
    <link rel="stylesheet" href="./style.css">
    <title>新人福利</title>
  	<script>
  		　document.write("<link rel='stylesheet' href='./base.css?v="+Math.random()+"'>");


         function getOption(key) {
             if (window.location) {
                 var search = location.search;
                 if (search == "") {
                     return "";
                 }
                 search = search.slice(1);
                 var searchArr = search.split("&");
                 var length_1 = searchArr.length;
                 for (var i = 0; i < length_1; i++) {
                     var str = searchArr[i];
                     var arr = str.split("=");
                     if (arr[0] == key) {
                         return arr[1];
                     }
                 }
             }
             return "";
         }



         // if (getOption("openid") == "") {
         //     let code = window.localStorage.getItem("WX_MQ_CODE_EX");
         //     let uid = window.localStorage.getItem("WX_MQ_UID_EX");
         //     if (code == null || code == "" || uid == null || uid == "") {
         var urlCode = getOption("code");
         var localCode = localStorage.getItem('localCode');
         function getCode(urlCode, localCode)
         {
             if (urlCode == null || urlCode == "") {
                 location.href = "" +
                     "https://open.weixin.qq.com/connect/oauth2/authorize?" +
                     "appid=" + "wx0d10c5a740e887f4" +
                     "&redirect_uri=" + encodeURIComponent(window.location.href.replace(location.search, "")) +
                     "&response_type=code" +
                     "&scope=snsapi_userinfo" +
                     "&state=1" +
                     "#wechat_redirect";
             } else if (urlCode == localCode) {
                 location.href = "" +
                     "https://open.weixin.qq.com/connect/oauth2/authorize?" +
                     "appid=" + "wx0d10c5a740e887f4" +
                     "&redirect_uri=" + encodeURIComponent(window.location.href.replace(location.search, "")) +
                     "&response_type=code" +
                     "&scope=snsapi_userinfo" +
                     "&state=1" +
                     "#wechat_redirect";
             } else if (localCode == null || urlCode == "") {
                 location.href = "" +
                     "https://open.weixin.qq.com/connect/oauth2/authorize?" +
                     "appid=" + "wx0d10c5a740e887f4" +
                     "&redirect_uri=" + encodeURIComponent(window.location.href.replace(location.search, "")) +
                     "&response_type=code" +
                     "&scope=snsapi_userinfo" +
                     "&state=1" +
                     "#wechat_redirect";
             }
         }


         // }
         // }
  	</script>
</head>

<script>

</script>

<body>
<div id="app" v-cloak>
    <div id="top">
        <div id="top-img">
            <img :src="imgUrl" alt="">
        </div>
        <div id="top-name">
            <span>{{nick}}</span>
        </div>
    </div>
    <div id="mid">
        <div>
            <div v-if="state == 1 || state == 2
"  class="new-top">
                <img class="new" src="./img/mid.png" alt="">
                <img id="new-img" src="./img/new-img.png" alt="">
                <div id="money">红包券 x 50</div>
            </div>
            <div v-else  class="new-top new-top-mask">
                <img class="new" src="./img/mid.png" alt="">
                <img id="new-img" src="./img/new-img.png" alt="">
                <div id="money">红包券 x 50</div>
                <img class="mini-mask" src="./img/mini-mask.png" alt="">
                <div class="already"><img  class="already-img"  src="./img/already.png" alt=""></div>
            </div>


            <div class="btn" v-if="state == 1" @click="receive">
                <img src="./img/btn.gif" alt="">
            </div>
            <div  v-else-if="state == 2">

            </div>
            <div class="btn-noctic" v-else>

            </div>

            <div id="notice">
                <div>
                    前往游戏内“每日福利”页面，还可领取每日关注奖励
                </div>
            </div>
        </div>

    </div>
    <div id="foot">

    </div>
</div>
</body>
<!-- import Vue before Element -->
<script src="./vue.min.js"></script>
<!-- import JavaScript -->
<script src="./index.js"></script>
<script src="./axios.min.js"></script>
<script>
 	document.write("<script type='text/javascript' src='./base.js?v="+Math.random()+"'><\/script>");

</script>

</html>
